package com.crm.model.vo.csd.customerManager;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * @author yincuimei
 * @Date 2021/8/31 10:04
 */
@Data
public class ContractDetailVO {
    //合同id
    private String contractId;

    //合同类型
    private String contractType;

    //合同编号
    private String contractNumber;

    //合同类型(前端合同类型显示值)
    private String contractTypeText;

    //合同开始日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractStartDate;

    //合同结束日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractEndDate;

    //客户联系人名称
    private String contactName;

    //客户邮箱
    private String customerEmail;

    //联系方式
    private String contactDetails;

    //合同状态
    private String contractStatus;

    //合同状态(页面显示值)
    private String contractStatusText;

    public String getContractTypeText(){
        String contractTypeText = "";
        if(!StringUtils.isBlank(contractType)){
            switch(contractType){
                case "1" :
                    contractTypeText = "非会员合同";
                    break;
                case "2" :
                    contractTypeText = "会员新单合同";
                    break;
                case "3" :
                    contractTypeText = "活动合同";
                    break;
                case "4" :
                    contractTypeText = "会员续费合同";
                    break;
                case "5" :
                    contractTypeText = "兑换合同";
                    break;
                case "6" :
                    contractTypeText = "单品合同";
                    break;
                case "7" :
                    contractTypeText = "会员单次";
                    break;
                default :
                    break;
            }
        }
        return contractTypeText;
    }

    public String getContractStatusText(){
        String contractStatusText = "";
        if(!StringUtils.isBlank(contractStatus)){
            switch(contractStatus){
                case "1" :
                    contractStatusText = "未生效";
                    break;
                case "2" :
                    contractStatusText = "生效中";
                    break;
                case "3" :
                    contractStatusText = "已结束";
                    break;
                case "4" :
                    contractStatusText = "已作废";
                    break;
                case "5" :
                    contractStatusText = "意外终止";
                    break;
                case "6" :
                    contractStatusText = "意外终止";
                    break;
                default :
                    break;
            }
        }
        return contractStatusText;
    }
}


